package com.mall;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;

import com.alibaba.android.arouter.launcher.ARouter;
import com.examination.mlib.constants.ARouterConstants;
import com.examination.mlib.interfaceapi.MallBackApi;

public class MallUtils  {
    /**
     * android-rn
     *
     * @param context
     * @param pluginId
     * @param componentName
     */
    public static void push(Context context, String pluginId, String componentName) {
        MallBackApi mallBackApi = (MallBackApi) ARouter.getInstance().build(ARouterConstants.MallModuleImpl).navigation();
        mallBackApi.Android2RnPush(context, pluginId, componentName);
    }

    /**
     * rn-android
     *
     * @param context
     * @param pluginId
     * @param componentName
     * @param bundle
     */
    public static void push(Context context, String pluginId, String componentName, Bundle bundle) {
        MallBackApi mallBackApi = (MallBackApi) ARouter.getInstance().build(ARouterConstants.MallModuleImpl).navigation();
        mallBackApi.Android2RnPush(context, pluginId, componentName, bundle);
    }

    /**
     * @param activity activity
     */
    public static View getMainTabLayoutView(Activity activity) {
        MallBackApi homeBackApi = (MallBackApi) ARouter.getInstance().build(ARouterConstants.MallModuleImpl).navigation();
        return homeBackApi.getMainTabLayoutView(activity);
    }
}
